home *** CD-ROM | disk | FTP | other *** search
- package symantec.itools.db.awt;
-
- import java.awt.Image;
-
- public class ImageStringData implements Data {
- StringBuffer text;
- // $FF: renamed from: im java.awt.Image
- Image field_0;
- String origText;
- boolean changed;
- DataSource dataSource;
-
- public ImageStringData(DataSource var1) {
- this(var1, "", (Image)null);
- }
-
- public ImageStringData(DataSource var1, String var2) {
- this(var1, var2, (Image)null);
- }
-
- public ImageStringData(DataSource var1, Image var2) {
- this(var1, (String)null, var2);
- }
-
- public ImageStringData(DataSource var1, String var2, Image var3) {
- this.changed = false;
- this.dataSource = var1;
- this.text = new StringBuffer(var2);
- this.origText = var2;
- this.field_0 = var3;
- }
-
- public int type() {
- if (this.text != null && this.field_0 != null) {
- return 3;
- } else {
- return this.field_0 == null ? 1 : 2;
- }
- }
-
- public boolean isEditable(int var1, int var2) {
- return this.dataSource.isDataEditable(var1, var2);
- }
-
- public boolean changed() {
- return this.changed;
- }
-
- public void rollback() {
- this.text.setLength(0);
- this.text.append(this.origText);
- this.changed = false;
- }
-
- public void commit() throws TypeNotSupported {
- if (this.changed) {
- this.origText = this.text.toString();
- this.changed = false;
- }
-
- }
-
- public boolean isMasked() {
- return false;
- }
-
- public String getMask() throws TypeNotSupported {
- throw new TypeNotSupported("ImageStringData does not support choices");
- }
-
- public boolean supportsChoice() {
- return false;
- }
-
- public Data[] getChoices() throws TypeNotSupported {
- throw new TypeNotSupported("ImageStringData does not support choices");
- }
-
- public void setImage(Image var1) {
- this.changed = true;
- this.field_0 = var1;
- }
-
- public void setText(String var1) {
- this.text.setLength(0);
- this.text.append(var1);
- this.changed = true;
- }
-
- public void setText(char var1) {
- this.text.setLength(0);
- this.text.append(var1);
- this.changed = true;
- }
-
- public void insertChar(int var1, char var2) {
- this.text.insert(var1, var2);
- this.changed = true;
- }
-
- public void appendChar(char var1) {
- this.text.append(var1);
- this.changed = true;
- }
-
- public String subString(int var1, int var2) {
- return this.text.toString().substring(var1, var2);
- }
-
- public void deleteChar(int var1) {
- if (var1 > 0) {
- String var2 = this.text.toString();
- this.text.setLength(0);
- this.changed = true;
- if (var1 >= var2.length()) {
- this.text.append(var2.substring(0, var2.length() - 1));
- } else {
- this.text.append(var2.substring(0, var1 - 1));
- this.text.append(var2.substring(var1, var2.length()));
- }
- }
- }
-
- public void clearText() {
- this.text.setLength(0);
- this.changed = true;
- }
-
- public String toString() {
- return this.text.toString();
- }
-
- public Image toImage() {
- return this.field_0;
- }
- }
-